/**
 *
 */
package bj

import bj.actor.Player
import bj.actor.RemotePlayer
import bj.actor.House
import bj.actor.Dealer
import scala.actors.Actor
import bj.actor.Go
import bj.util.Logs
import org.apache.log4j.Logger
import org.apache.log4j.Level
import org.apache.log4j.PropertyConfigurator

case class Done
case class Launch


/**
 * @author PaCollins
 *
 */
object Game extends Logs {
  //  Logger.getLogger(getClass).setLevel(Level.DEBUG)
  //    
  PropertyConfigurator.configure("log4j.properties")
  
  
 // RemoteActor.classLoader = getClass().getClassLoader()
  /** My service name */
  //val SERVER_NAME = 'jackBlack_Casino
    
  /** My service port */
  //val SERVER_PORT = 14500

  def main(args: Array[String]): Unit = {
    
    //val localHost = InetAddress.getLocalHost
    //val gameServerAddr = localHost.getHostAddress
    
    //val gameServer = new GameServer(SERVER_NAME, gameServerAddr,SERVER_PORT).start   
    	//println("GameServer " + SERVER_NAME + " @ " + gameServerAddr + " STARTED")
   
    debug("starting the house")
    //House.start

    Thread.sleep(1000)
    
     

    val aPlayer = new RemotePlayer('test, "192.168.1.25", 50122, "remoteJack", 2500, 0.01)
    //val lPlayer = new Player(name, 0, 0)
    
    debug("starting players")
    /*
    val players = List[Player](new Player("Ron", 100, 30),
      new Player("Patrick", 500, 50),
      new Player("Jack", 1500, 250),
      new Player(rPlayer.rName, rPlayer.rBank, rPlayer.rBet))
    
    def act {
      loop {
        react {
          case newPlayer(aPlayer: Player) => val players = List[Player](aPlayer)
        		  										   Player.start(players)
        }
      }
    }
   */
    //val players = List[Player](aPlayer)

    //Player.start(players)

    Thread.sleep(1000)

    debug("telling house go")
    House ! Go
  }
}
